<style lang=sass>
@import "../../assets/sass/radio/radiogroup.scss";
</style>

<template>
<div class="vue-radio-group" >
	<radio v-for="item in options" :option="item" @changed="onChanged"></radio>
</div>
</template>

<script>
import Radio from "./radio"


export default{
	props:{
		options:Array
	},
	data(){
		return{
			value:""
		}
	},
	created:function(){
		for(var i=0,len=this.options.length;i<len;i++){
			if(this.options[i]['checked']=="checked"){
				this.value=this.options[i]['value'];
			}
		}
	},
	components:{
		Radio
	},
	methods:{
		onChanged:function(item){
			this.$emit("changed",item);
		}
	}
}
</script>